<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<div mm="xx">aaa</div>
<div name="b">bbb</div>
<div id="b" class="cc">ccc</div>
<script>
    var obj1 = document.getElementsByName('b')
    var obj2 = document.getElementsByTagName('div')
    for(var i = 0,len = obj2.length;i<len;i++){
      //  console.log(obj2[i]);
    }

    var obj3 = document.getElementById('b');

//其它找元素
    var obj4 = document.getElementsByClassName('cc');
    var obj5 = document.querySelector("div");

    //querySelector getElementById 一样，找到某一个具体的元素
    //querySelectorAll 多个，NodeList
    //querySelector 中的字符规则同css选择器相似
    var obj6 = document.querySelectorAll("[mm]")
    console.log(obj6)





</script>
</body>
</html>